Add Google GenAI plugin samples#319
Open
brianstrauch wants to merge 2 commits into
Open
Conversation
Add a google_genai_plugin/ sample suite for temporalio.contrib.google_genai, mirroring the strands_plugin/ layout (one feature per sub-directory, each with workflow.py / run_worker.py / run_workflow.py / README.md). Samples cover every major plugin feature: - hello_world: generate_content - tools: automatic function calling (activity_as_tool + plain workflow-method tool) - streaming: generate_content_stream + streaming_topic/WorkflowStream - chat: multi-turn client.chats - structured_output: response_schema + Pydantic - mcp: TemporalMcpClientSession with a local echo MCP server - files: client.files.upload (live API) - interactions: client.interactions stateful API (live API) - agents: client.agents CRUD (live API) - vertex_ai: vertexai=True configuration (GCP credentials) Tests under tests/google_genai_plugin/ use the plugin's GeminiTestServer to run the model-layer samples offline; the mcp test additionally registers a real echo MCP server. files/interactions/agents/vertex_ai are runnable-only (require live credentials) and documented as such. Register the suite in pyproject.toml (google-genai dependency group + wheel package), the root README, and CODEOWNERS. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Wrap the workflow.py, run_worker.py, and run_workflow.py bodies of each sample in @@@SNIPSTART/@@@SNIPEND markers (python-google-genai-<sample>-<part>) so the code can be embedded in docs, matching the strands_plugin convention. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
google_genai_plugin/sample suite fortemporalio.contrib.google_genai, mirroring thestrands_plugin/layout (one feature per sub-directory, each withworkflow.py/run_worker.py/run_workflow.py/README.md).Samples
hello_worldgenerate_contenttoolsactivity_as_tool+ plain workflow-method tool)streaminggenerate_content_stream+streaming_topic/WorkflowStreamchatclient.chatsstructured_outputresponse_schema+ PydanticmcpTemporalMcpClientSessionwith a local echo MCP serverfilesclient.files.uploadinteractionsclient.interactionsstateful APIagentsclient.agentsCRUDvertex_aivertexai=TrueconfigurationTests
tests/google_genai_plugin/uses the plugin'sGeminiTestServerto run the model-layer samples offline (no API key); themcptest additionally registers a real echo MCP server. Thefiles/interactions/agents/vertex_aisamples talk to backendsGeminiTestServerdoes not mock, so they are runnable-only and documented as requiring live credentials.Registration
pyproject.toml:google-genaidependency group (temporalio[google-genai,pydantic]+mcp) and wheel packageREADME.mdsample listing.github/CODEOWNERSVerification
uv run pytest tests/google_genai_plugin/→ 6 passedmypy --check-untyped-defs --namespace-packages→ no issuesruff format --check+ruff check --select I→ clean🤖 Generated with Claude Code